SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vw_20042008
AS
select distinct nombre,cuise,'2004' as Falta from vw_EscuelasSinNovedadesAlumnos where cuise not in(select distinct cuise from vw_EscuelasSinNovedadesAlumnos where aniolectivo = 2004)--order by cuise
union
select distinct nombre,cuise,'2005' as Falta from vw_EscuelasSinNovedadesAlumnos where cuise not in(select distinct cuise from vw_EscuelasSinNovedadesAlumnos where aniolectivo = 2005)--order by cuise
union
select distinct nombre,cuise,'2006' as Falta from vw_EscuelasSinNovedadesAlumnos where cuise not in(select distinct cuise from vw_EscuelasSinNovedadesAlumnos where aniolectivo = 2006)--order by cuise
union
select distinct nombre,cuise,'2007' as Falta from vw_EscuelasSinNovedadesAlumnos where cuise not in(select distinct cuise from vw_EscuelasSinNovedadesAlumnos where aniolectivo = 2007)--order by cuise
union
select distinct nombre,cuise,'2008' as Falta from vw_EscuelasSinNovedadesAlumnos where cuise not in(select distinct cuise from vw_EscuelasSinNovedadesAlumnos where aniolectivo = 2008)--order by cuise
GO
